from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class Cate(db.Model):
    id = db.Column(db.Integer,primary_key=True,autoincrement=True)
    name = db.Column(db.String(50),unique=True)

    good = db.relationship("Goods",backref="cate")



class Goods(db.Model):
    id = db.Column(db.Integer,primary_key=True,autoincrement=True)
    name = db.Column(db.String(50),unique=True)
    price = db.Column(db.Integer)
    cate_id = db.Column(db.Integer,db.ForeignKey("cate.id"))
